#include <stdio.h>
#include <string.h>
#include <sys/socket.h>
#include <netinet/in.h>

int main()
{
    int sockfd;
    struct sockaddr_in servaddr;

    sockfd = socket(PF_INET, SOCK_DGRAM, 0);

    bzero(&servaddr, sizeof(servaddr));
    servaddr.sin_family = AF_INET;
    servaddr.sin_port = htons(50001);
    servaddr.sin_addr.s_addr = inet_addr("127.0.0.1");

    char sendline[100];
	scanf("%s",sendline);

    sendto(sockfd, sendline, strlen(sendline), 0, (struct sockaddr *)&servaddr, sizeof(servaddr));
	memset(sendline,0,sizeof(sendline));
	//recvfrom(sockfd, sendline, sizeof(sendline), 0, NULL, NULL);
	recv(sockfd, sendline, sizeof(sendline), 0);
	printf("%s\n",sendline);
    close(sockfd);

    return 0;
}